package Leetcode;

public class canJump {
    public boolean canJump(int[] nums) {
        int n = 0;
        for (int i = 0; i < nums.length && i <= n; i++) {
            n = Math.max(i + nums[i], n);
        }
        return n >= nums.length - 1;
    }
}
